package com.zhouyu.service;

import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;
import org.springframework.context.event.EventListener;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.PostConstruct;
import java.util.Date;

@Component
//@Scope("prototype")
public class UserService {

	@Autowired
	private OrderService orderService;

	public UserService(){

//		System.out.println(0);
	}

	public UserService(OrderService orderService){
		System.out.println(1);
		this.orderService = orderService;
		System.out.println("userService构造方法"+orderService);
	}

	@EventListener
	public void a(ApplicationEvent a){
		System.out.println(a);
	}

	public void setOrderService(OrderService orderService) {
		this.orderService = orderService;
	}

	public void test(){
		System.out.println(orderService);
	}

	public void c(){
		System.out.println("C");
	}


}
